package com.cloudconsumerfeign.service;

import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.context.annotation.ComponentScan;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;

import com.cloud.api.commons.pojo.CommonResult;

/**
 * 使用feign调用某一个微服务
 * @author kaifa008
 *
 */
@SuppressWarnings("rawtypes")
@ComponentScan
@FeignClient(value = "mcroservice-payment") // 使用Feign
public interface PaymentService {
	
	@GetMapping("/payment/get/{id}")
	public CommonResult queryById(@PathVariable("id") String id);

	/**
	 * 调用生产者微服务名称为mcroservice-payment下边的模拟超时的接口
	 * @return
	 * @throws InterruptedException
	 */
    @GetMapping("/payment/feign/timeout")
    public String PaymentFeignTimeOut() throws InterruptedException;

}